/*
 * Copyright 2010 Alexey Romensky
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

/*
 * User: Alexey Romensky
 * Date: 20.02.2010
 * Time: 20:07:49
 */
package com.googlecode.gwt.logging.api.client.impl;

import com.googlecode.gwt.logging.api.client.LogWriter;
import org.apache.commons.logging.Log;

public class CommonsLogAdapter extends AbstractLogAdapter implements Log {

    private static final String THIS_FILE_NAME = "Slf4jLoggerAdapter.java";

    public CommonsLogAdapter(LogWriter log) {
        super(log);
    }

    @Override
    public boolean isDebugEnabled() {
        return log.isDebugEnabled(null);
    }

    @Override
    public boolean isErrorEnabled() {
        return log.isErrorEnabled(null);
    }

    @Override
    public boolean isFatalEnabled() {
        return log.isFatalEnabled(null);
    }

    @Override
    public boolean isInfoEnabled() {
        return log.isInfoEnabled(null);
    }

    @Override
    public boolean isTraceEnabled() {
        return log.isTraceEnabled(null);
    }

    @Override
    public boolean isWarnEnabled() {
        return log.isWarnEnabled(null);
    }

    @Override
    public void trace(Object message) {
        log.trace(new CommonsLogData(THIS_FILE_NAME, message));
    }

    @Override
    public void trace(Object message, Throwable t) {
        log.trace(new CommonsLogData(THIS_FILE_NAME, message, t));
    }

    @Override
    public void debug(Object message) {
        log.debug(new CommonsLogData(THIS_FILE_NAME, message));
    }

    @Override
    public void debug(Object message, Throwable t) {
        log.debug(new CommonsLogData(THIS_FILE_NAME, message, t));
    }

    @Override
    public void info(Object message) {
        log.info(new CommonsLogData(THIS_FILE_NAME, message));
    }

    @Override
    public void info(Object message, Throwable t) {
        log.info(new CommonsLogData(THIS_FILE_NAME, message, t));
    }

    @Override
    public void warn(Object message) {
        log.warn(new CommonsLogData(THIS_FILE_NAME, message));
    }

    @Override
    public void warn(Object message, Throwable t) {
        log.warn(new CommonsLogData(THIS_FILE_NAME, message, t));
    }

    @Override
    public void error(Object message) {
        log.error(new CommonsLogData(THIS_FILE_NAME, message));
    }

    @Override
    public void error(Object message, Throwable t) {
        log.error(new CommonsLogData(THIS_FILE_NAME, message, t));
    }

    @Override
    public void fatal(Object message) {
        log.fatal(new CommonsLogData(THIS_FILE_NAME, message));
    }

    @Override
    public void fatal(Object message, Throwable t) {
        log.fatal(new CommonsLogData(THIS_FILE_NAME, message, t));
    }
}
